using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Backend.JYD.AModel.Models.Mapping
{
    public class IncomeMap : EntityTypeConfiguration<Income>
    {
        public IncomeMap()
        {
            // Primary Key
            this.HasKey(t => t.IncomeId);

            // Properties
            this.Property(t => t.CustNo)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("Income");
            this.Property(t => t.IncomeId).HasColumnName("IncomeId");
            this.Property(t => t.CustNo).HasColumnName("CustNo");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Source).HasColumnName("Source");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.OccurDate).HasColumnName("OccurDate");
            this.Property(t => t.TaskId).HasColumnName("TaskId");
            this.Property(t => t.TaskDetailId).HasColumnName("TaskDetailId");
        }
    }
}
